import requests as rq
import ActorClient
import module

bind = ActorClient.ClientAPIBind()
if bind.Connect("114.116.205.73"):
    print("Success Connect")
else:
    print("Fail Connect")
    quit()

if bind.Login("6bc37c40-84af-46d2-8938-1a81ea6cebf5"):
    print(bind.GetUUID())
else:
    print("login error")
    quit()

info = module.ActorInfo("robot", "car")

if bind.SetInfo(info):
    print("Set Actor Info success")
else:
    print("Fail set info")

info = bind.GetInfo()
if info:
    print("Getinfo success")
    print(info)

state = module.ActorState(module.Position(100, 1020), 10, 90)

if bind.SetState(state):
    print("Set State Success")
else:
    print("Set State fail")

state = bind.GetState()
if info:
    print("Get state success")
    print(state)

command = module.MoveCommand(module.Position(
    0, 0), module.Position(100, 20), bind.GetUUID())

if bind.SetCommand(command):
    print("Set Command Success")
else:
    print("Set Command fail")

command = bind.GetCommand()
if command:
    print("Get Command success")
    print(command)

path = module.Path(1, [module.Position(0, 0), module.Position(100, 20)])
if bind.SetPath(path):
    print("Set path success")

input("press any key to logout")

if bind.Logout():
    print("logout success")
else:
    print("logout fail")
